<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/6/18
 * Time: 10:45
 */

$myserv = new swoole_http_server('127.0.0.1',9111);
$myserv->on('start',function(){
    echo "欢迎来到环山村1号";
});

$myserv->on('request',function($request,$response){
    $response->header('Content-Type','text/html; charset=UTF-8'); #这行置关重要，作为中国人，你一定希望你的页面能愉快的显示中文
    $response->end('唔，呃～劲儿弟弟的脚味儿有点大，几天没洗袜子了');
});

$myserv->start();